package base.controller;

import base.bean.CheckinEntity;
import base.bean.CheckoutEntity;
import base.dao.ICheckoutDao;
import base.service.ICheckOutService;
import base.service.ICheckService;
import base.utils.ChangeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by 30509 on 2018/3/18.
 */
@Controller
@RequestMapping("/test")
public class OutController {
    @Autowired
    ICheckService iCheckService;
    @Autowired
    ICheckOutService iCheckOutService;
    @RequestMapping("/roomcheckout")
    private ModelAndView checkout(){
        ModelAndView checkout = new ModelAndView();
        List<CheckinEntity> list = iCheckService.findExceptCheckOut();

        checkout.addObject("cc", list);
        checkout.setViewName("roomcheckout");
        return checkout;
    }

    @RequestMapping("/checkoutroom")
    private ModelAndView queryForSave(HttpServletRequest request){
        ModelAndView checkout = new ModelAndView();
        String idd = request.getParameter("id");
        int id = ChangeUtils.parseInt(idd,-1);
        return checkout;
    }



}
